# VS Code Settings Vue
Vuemastery optimizing VScode (opens new window)
# Configuring Prettier
Prettier configuration file, to add some special settings
.prettierrc.js
// .prettierrc.js
module.exports = {
singleQuote: true,
semi: true
}
# Configuring ESLint
Create an .eslintrc.js file as a dedicated configuration file, instead of the eslintConfig option from package.json. Can be written in JavaScript syntax -› more flexible than JSON.
.eslintrc.js
add
"extends": [
"plugin:vue/vue3-essential",
"@vue/prettier", // ADD
"eslint:recommended"
],
maybe add to rules:
rules: {
...
'no-unused-vars': ['warn'],
},
# VS Code User Settings
Turn off Vetur’s linting feature. Instead rely on ESLint + Prettier
"vetur.validation.template": falseTell ESLint what languages to validate (vue, html, and javascript) and set
autoFixtotrueon each:"eslint.validate": [ { "language": "vue", "autoFix": true }, { "language": "html", "autoFix": true }, { "language": "javascript", "autoFix": true } ],
# Extensions
Vue VSCode Snippets Sarah Drasner
vif:v-ifstatementvon: full event handlervdata: data propertyvpropsvimport-lib
if you’re using this Snippets extension, disable Vetur’s scaffold feature:
vs code
settings.json:"vetur.completion.useScaffoldSnippets": false,